package com.sure.supermarketserver.sell.vip.impl;

import com.sure.supermarketserver.common.Utils;
import com.sure.supermarketserver.sell.vip.VipDto;
import com.sure.supermarketserver.sell.vip.VipService;
import com.sure.supermarketserver.sell.vip.dao.VipDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

@Service
@Transactional
public class VipServiceimpl implements VipService {


    @Resource
    private VipDao vipDao;

    //查询
    @Override
    public Map<String, Object> getVipList(VipDto dto) {
        return Utils.getPage(dto, ()-> vipDao.findVipList(dto));
    }

    //增加
    @Override
    public void addVip(VipDto dto) {
        vipDao.insertVip(dto);
    }

    //修改
    @Override
    public void updateVip(VipDto dto) {
        vipDao.updateVip(dto);
    }

    //删除
    @Override
    public void deleteVip(Integer id) {
        vipDao.deleteVip(id);
    }




}
